package com.example.comiccenter.controller;


import com.example.comiccenter.domain.Collect;
import com.example.comiccenter.service.CollectService;
import com.example.comiccenter.utils.ResultData;
import com.example.comiccenter.utils.SearchBean;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
@RequestMapping("/collect")
public class CollectController {
    @Resource
    private CollectService collectService;


    //分页查询
    @PostMapping("/getAllCollect")
    public ResultData selectPage(@RequestBody SearchBean<Collect> searchBean){
        System.out.println("查询collect");
        return collectService.getAllCollect(searchBean);
    }

    //添加收藏
    @PostMapping("/addCollect")
    public ResultData addcollect(@RequestBody Collect collect){
        return collectService.addCollect(collect);
    }

    //取消收藏
    @PostMapping("/deleteCollect")
    public ResultData deletecollect(@RequestBody Collect collect){
        System.out.println("删除collect："+collect);
        return collectService.deleteCollect(collect);
    }

}
